import java.util.Scanner;

/**
 * 输入一个正整数，按照从小到大的顺序输出它的所有质数的因子（如180的质数因子为2 2 3 3 5 ）
 * Created by JiaJia on 2019/6/19 0019.
 */
public class HuaWei006 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        while (scanner.hasNext()){
            Long number=scanner.nextLong();
            System.out.println(findPrimes(number));
        }
        scanner.close();
    }
    private static String findPrimes(Long num){
        StringBuilder sb=new StringBuilder();
        long i=2;
        while (i<=num){
            while (num%i==0){
                sb.append(i).append(" ");
                num/=i;
            }
            i++;
        }
        return sb.toString();
    }

}